package com.hongxia.assetsys.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName tb_task_mytask
 */
@TableName(value ="tb_task_mytask")
@Data
public class TaskMytask implements Serializable {
    /**
     * 
     */
    @TableId
    private Integer id;

    /**
     * 
     */
    private Integer userId;

    /**
     * 攻防任务id
     */
    private Integer taskId;

    /**
     * 0-等待接受 ；1-已接收未完成； 2- 正常完成；-1 -拒绝接受
     */
    private String finishedStatus;

    /**
     * 完成时间
     */
    private Date finishedTime;

    /**
     * 提交的漏洞扫描个数
     */
    private Integer submitScanNum;

    /**
     * 提交的漏洞利用个数
     */
    private Integer submitExploitNum;

    /**
     * 完成的横向移动个数
     */
    private Integer submitMoveNum;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TaskMytask other = (TaskMytask) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getTaskId() == null ? other.getTaskId() == null : this.getTaskId().equals(other.getTaskId()))
            && (this.getFinishedStatus() == null ? other.getFinishedStatus() == null : this.getFinishedStatus().equals(other.getFinishedStatus()))
            && (this.getFinishedTime() == null ? other.getFinishedTime() == null : this.getFinishedTime().equals(other.getFinishedTime()))
            && (this.getSubmitScanNum() == null ? other.getSubmitScanNum() == null : this.getSubmitScanNum().equals(other.getSubmitScanNum()))
            && (this.getSubmitExploitNum() == null ? other.getSubmitExploitNum() == null : this.getSubmitExploitNum().equals(other.getSubmitExploitNum()))
            && (this.getSubmitMoveNum() == null ? other.getSubmitMoveNum() == null : this.getSubmitMoveNum().equals(other.getSubmitMoveNum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getTaskId() == null) ? 0 : getTaskId().hashCode());
        result = prime * result + ((getFinishedStatus() == null) ? 0 : getFinishedStatus().hashCode());
        result = prime * result + ((getFinishedTime() == null) ? 0 : getFinishedTime().hashCode());
        result = prime * result + ((getSubmitScanNum() == null) ? 0 : getSubmitScanNum().hashCode());
        result = prime * result + ((getSubmitExploitNum() == null) ? 0 : getSubmitExploitNum().hashCode());
        result = prime * result + ((getSubmitMoveNum() == null) ? 0 : getSubmitMoveNum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", taskId=").append(taskId);
        sb.append(", finishedStatus=").append(finishedStatus);
        sb.append(", finishedTime=").append(finishedTime);
        sb.append(", submitScanNum=").append(submitScanNum);
        sb.append(", submitExploitNum=").append(submitExploitNum);
        sb.append(", submitMoveNum=").append(submitMoveNum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}